\hypertarget{radio__interface_8c}{
\section{front\_\-panel/radio\_\-interface.c File Reference}
\label{radio__interface_8c}\index{front\_\-panel/radio\_\-interface.c@{front\_\-panel/radio\_\-interface.c}}
}
Radio interface, such as PTT AMP, PTT Radio, CAT etc.  


{\tt \#include $<$stdio.h$>$}\par
{\tt \#include $<$stdlib.h$>$}\par
{\tt \#include $<$string.h$>$}\par
{\tt \#include $<$avr/io.h$>$}\par
{\tt \#include $<$avr/interrupt.h$>$}\par
{\tt \#include \char`\"{}radio\_\-interface.h\char`\"{}}\par
{\tt \#include \char`\"{}led\_\-control.h\char`\"{}}\par
{\tt \#include \char`\"{}band\_\-ctrl.h\char`\"{}}\par
{\tt \#include \char`\"{}main.h\char`\"{}}\par
{\tt \#include \char`\"{}usart.h\char`\"{}}\par
{\tt \#include \char`\"{}board.h\char`\"{}}\par
{\tt \#include \char`\"{}eeprom.h\char`\"{}}\par
{\tt \#include \char`\"{}display.h\char`\"{}}\par
{\tt \#include \char`\"{}../internal\_\-comm.h\char`\"{}}\par
{\tt \#include \char`\"{}../internal\_\-comm\_\-commands.h\char`\"{}}\par
{\tt \#include \char`\"{}../global.h\char`\"{}}\par
\subsection*{Functions}
\begin{CompactItemize}
\item 
\hypertarget{radio__interface_8c_31016159d2ba818a4350a3a4b8a8580a}{
void \hyperlink{radio__interface_8c_31016159d2ba818a4350a3a4b8a8580a}{radio\_\-interface\_\-init} (void)}
\label{radio__interface_8c_31016159d2ba818a4350a3a4b8a8580a}

\begin{CompactList}\small\item\em Initialize the radio interface. \item\end{CompactList}\item 
\hypertarget{radio__interface_8c_9622eaa68a7eb22b1e675730085ab0a0}{
void \hyperlink{radio__interface_8c_9622eaa68a7eb22b1e675730085ab0a0}{radio\_\-process\_\-tasks} (void)}
\label{radio__interface_8c_9622eaa68a7eb22b1e675730085ab0a0}

\begin{CompactList}\small\item\em This function is called each lap in the main loop and we can use this to process certain tasks. \item\end{CompactList}\item 
unsigned int \hyperlink{radio__interface_8c_be6b3a77368567c874ff9e7928aa20f5}{radio\_\-get\_\-current\_\-freq} (void)
\item 
unsigned char \hyperlink{radio__interface_8c_1bed199ceaacdb11c6f0449e9d864d6b}{radio\_\-get\_\-current\_\-band} (void)
\begin{CompactList}\small\item\em Retrieve the current band from the radio. \item\end{CompactList}\item 
\hypertarget{radio__interface_8c_ccffdcb09e8fc6a32df02fe22268f774}{
void \hyperlink{radio__interface_8c_ccffdcb09e8fc6a32df02fe22268f774}{radio\_\-ptt\_\-active} (void)}
\label{radio__interface_8c_ccffdcb09e8fc6a32df02fe22268f774}

\begin{CompactList}\small\item\em Activate the radio PTT. \item\end{CompactList}\item 
\hypertarget{radio__interface_8c_282c423a5968304bf393977e2aca1468}{
void \hyperlink{radio__interface_8c_282c423a5968304bf393977e2aca1468}{radio\_\-ptt\_\-deactive} (void)}
\label{radio__interface_8c_282c423a5968304bf393977e2aca1468}

\begin{CompactList}\small\item\em Deactivate the radio PTT. \item\end{CompactList}\item 
\hypertarget{radio__interface_8c_d6c6dd0edb44339684cb56ee5968c0d5}{
void \hyperlink{radio__interface_8c_d6c6dd0edb44339684cb56ee5968c0d5}{radio\_\-tx\_\-active} (void)}
\label{radio__interface_8c_d6c6dd0edb44339684cb56ee5968c0d5}

\begin{CompactList}\small\item\em Set the TX ACTIVE output to high. \item\end{CompactList}\item 
\hypertarget{radio__interface_8c_eb4c7b45ff52decc8cd6da2666f8f88e}{
void \hyperlink{radio__interface_8c_eb4c7b45ff52decc8cd6da2666f8f88e}{radio\_\-tx\_\-deactive} (void)}
\label{radio__interface_8c_eb4c7b45ff52decc8cd6da2666f8f88e}

\begin{CompactList}\small\item\em Set the TX ACTIVE output to high. \item\end{CompactList}\item 
\hypertarget{radio__interface_8c_ac6dcfef06b5c2f9bb8913b780889758}{
void \hyperlink{radio__interface_8c_ac6dcfef06b5c2f9bb8913b780889758}{radio\_\-inhibit\_\-high} (void)}
\label{radio__interface_8c_ac6dcfef06b5c2f9bb8913b780889758}

\begin{CompactList}\small\item\em Set the inhibit signal to high. \item\end{CompactList}\item 
\hypertarget{radio__interface_8c_10509297dec3040da555bc74e07dee04}{
void \hyperlink{radio__interface_8c_10509297dec3040da555bc74e07dee04}{radio\_\-inhibit\_\-low} (void)}
\label{radio__interface_8c_10509297dec3040da555bc74e07dee04}

\begin{CompactList}\small\item\em Set the inhibit signal to low. \item\end{CompactList}\item 
\hypertarget{radio__interface_8c_a5c9ee68be07e3cc4f7dbc2dbac9473d}{
unsigned char \hyperlink{radio__interface_8c_a5c9ee68be07e3cc4f7dbc2dbac9473d}{radio\_\-get\_\-ptt\_\-status} (void)}
\label{radio__interface_8c_a5c9ee68be07e3cc4f7dbc2dbac9473d}

\begin{CompactList}\small\item\em Retrieve the ptt status, defines can be found in \hyperlink{radio__interface_8h}{radio\_\-interface.h}. \item\end{CompactList}\item 
unsigned char \hyperlink{radio__interface_8c_4a29bb17605c63566c6daa1e2c3f901d}{radio\_\-get\_\-band\_\-portion} (void)
\item 
void \hyperlink{radio__interface_8c_3b706c4ccad36a652ad17edcfbb7ee5f}{radio\_\-set\_\-current\_\-band} (unsigned char band)
\item 
unsigned char \hyperlink{radio__interface_8c_3dba8d119c14a022fce5bfcaca9c0e30}{radio\_\-poll\_\-ptt} (void)
\begin{CompactList}\small\item\em Polls the status of the PTT input. \item\end{CompactList}\item 
unsigned char \hyperlink{radio__interface_8c_51982d5e8375a0187b093e49225e564f}{radio\_\-poll\_\-status} (void)
\begin{CompactList}\small\item\em Polls the status of the radio and saves it into the radio\_\-status structure. \item\end{CompactList}\item 
unsigned int \hyperlink{radio__interface_8c_16172b8cd72ef37b1e963d2a771c34ca}{radio\_\-parse\_\-freq} (unsigned char $\ast$freq\_\-data, unsigned char length, unsigned char radio\_\-model)
\begin{CompactList}\small\item\em Parse the radios frequency. \item\end{CompactList}\item 
\hypertarget{radio__interface_8c_dbaa59761b81f7ba3e92437db2680006}{
void \hyperlink{radio__interface_8c_dbaa59761b81f7ba3e92437db2680006}{radio\_\-amp\_\-ptt\_\-active} (void)}
\label{radio__interface_8c_dbaa59761b81f7ba3e92437db2680006}

\begin{CompactList}\small\item\em Activate PTT amp. \item\end{CompactList}\item 
\hypertarget{radio__interface_8c_c317b76e083257d47fe444dc9a3e8a46}{
void \hyperlink{radio__interface_8c_c317b76e083257d47fe444dc9a3e8a46}{radio\_\-amp\_\-ptt\_\-deactive} (void)}
\label{radio__interface_8c_c317b76e083257d47fe444dc9a3e8a46}

\begin{CompactList}\small\item\em Deactivate PTT amp. \item\end{CompactList}\item 
unsigned char \hyperlink{radio__interface_8c_caebb53da61230cc0e72ac7fca61fe3f}{radio\_\-freq\_\-to\_\-band} (unsigned int freq)
\begin{CompactList}\small\item\em Convert a radio frequency (integer) to band data. \item\end{CompactList}\item 
void \hyperlink{radio__interface_8c_7ee8e87d9f7b3979d0c50ba2cae7b848}{radio\_\-interface\_\-set\_\-model} (unsigned char model)
\begin{CompactList}\small\item\em Set which radio model is used, saves it in the radio\_\-settings struct. \item\end{CompactList}\item 
void \hyperlink{radio__interface_8c_7e697ec02d32d0e31b1c42f33a90ec2d}{radio\_\-interface\_\-set\_\-interface} (unsigned char interface\_\-type)
\begin{CompactList}\small\item\em Set which radio interface is used, saves it in the radio\_\-settings struct. \item\end{CompactList}\item 
void \hyperlink{radio__interface_8c_179f074e00b02b7d16524c73bb9c44c9}{radio\_\-interface\_\-set\_\-baudrate} (unsigned char baudrate)
\begin{CompactList}\small\item\em Set which baudrate setting is used, saves it in the radio\_\-settings struct. \item\end{CompactList}\item 
void \hyperlink{radio__interface_8c_1993418adabfb6bc52752bda6321dd15}{radio\_\-interface\_\-set\_\-stopbits} (unsigned char stopbits)
\begin{CompactList}\small\item\em Set which number of stopbits should be used, saves it in the radio\_\-settings struct. \item\end{CompactList}\item 
void \hyperlink{radio__interface_8c_55390d2f6dd666ee613bad3e24318f52}{radio\_\-interface\_\-set\_\-civ\_\-addr} (unsigned char civ)
\begin{CompactList}\small\item\em Set which CI-V address the radio has got, saves it in the radio\_\-settings struct. \item\end{CompactList}\item 
void \hyperlink{radio__interface_8c_ed43356a1535b55a5a6dbe2f456b1a25}{radio\_\-interface\_\-set\_\-ptt\_\-input} (unsigned char ptt\_\-input)
\begin{CompactList}\small\item\em Set which PTT input that is used, saves it in the radio\_\-settings struct. \item\end{CompactList}\item 
void \hyperlink{radio__interface_8c_2f6356092aad19af9b7c162c6c3d83e8}{radio\_\-interface\_\-set\_\-poll\_\-interval} (unsigned char poll\_\-interval)
\begin{CompactList}\small\item\em Set the poll intervall for the radio band decoding, saves it in the radio\_\-settings struct. \item\end{CompactList}\item 
unsigned char \hyperlink{radio__interface_8c_e611bf1461b229d7cc0d2c43a832f52a}{radio\_\-interface\_\-get\_\-model} (void)
\begin{CompactList}\small\item\em Get which radio model is used. \item\end{CompactList}\item 
unsigned char \hyperlink{radio__interface_8c_2a21b606f4854195179fba78e566dc68}{radio\_\-interface\_\-get\_\-interface} (void)
\begin{CompactList}\small\item\em Get which radio interface is used. \item\end{CompactList}\item 
unsigned char \hyperlink{radio__interface_8c_1a39fb3b7db71c081267934fefd0f425}{radio\_\-interface\_\-get\_\-baudrate} (void)
\begin{CompactList}\small\item\em Get which baudrate setting is used. \item\end{CompactList}\item 
unsigned char \hyperlink{radio__interface_8c_4f306aeac84c991bcac2bd62d2dad854}{radio\_\-interface\_\-get\_\-stopbits} (void)
\begin{CompactList}\small\item\em Get which number of stopbits should be used. \item\end{CompactList}\item 
unsigned char \hyperlink{radio__interface_8c_ef0cb2a66f8e664a436d8438ece9e581}{radio\_\-interface\_\-get\_\-civ\_\-addr} (void)
\begin{CompactList}\small\item\em Get which CI-V address the radio has got. \item\end{CompactList}\item 
unsigned char \hyperlink{radio__interface_8c_4874445eead299650a432340c81e8e71}{radio\_\-interface\_\-get\_\-ptt\_\-input} (void)
\begin{CompactList}\small\item\em Get which PTT input that is used. \item\end{CompactList}\item 
unsigned char \hyperlink{radio__interface_8c_7552853363a7931bfbf9ee315c6e5c47}{radio\_\-interface\_\-get\_\-poll\_\-interval} (void)
\begin{CompactList}\small\item\em Get the poll intervall for the radio band decoding. \item\end{CompactList}\item 
\hypertarget{radio__interface_8c_fbc293e0131dbef8955df4b364d5c3d5}{
void \hyperlink{radio__interface_8c_fbc293e0131dbef8955df4b364d5c3d5}{radio\_\-interface\_\-load\_\-eeprom} (void)}
\label{radio__interface_8c_fbc293e0131dbef8955df4b364d5c3d5}

\begin{CompactList}\small\item\em This function will load data from the eeprom to the radio\_\-settings struct. \item\end{CompactList}\item 
void \hyperlink{radio__interface_8c_04e120b697031fe7765c1b91eb8a7402}{radio\_\-communicaton\_\-timeout} (void)
\item 
unsigned char \hyperlink{radio__interface_8c_b3eaafedab168f67c06084b7c8748d16}{radio\_\-get\_\-cat\_\-status} (void)
\item 
\hypertarget{radio__interface_8c_1ca9f9e64ee42dc4b2b8a797aa3ffa3c}{
\textbf{ISR} (SIG\_\-USART3\_\-DATA)}
\label{radio__interface_8c_1ca9f9e64ee42dc4b2b8a797aa3ffa3c}

\item 
\hypertarget{radio__interface_8c_cb7dc7499e44900e295778ac53f36c5d}{
\hyperlink{radio__interface_8c_cb7dc7499e44900e295778ac53f36c5d}{ISR} (SIG\_\-USART3\_\-RECV)}
\label{radio__interface_8c_cb7dc7499e44900e295778ac53f36c5d}

\begin{CompactList}\small\item\em Interrupt which is called when a byte is received on the UART. \item\end{CompactList}\end{CompactItemize}
\subsection*{Variables}
\begin{CompactItemize}
\item 
\hypertarget{radio__interface_8c_3c4c46cf56117ca53071ba61db9004fb}{
unsigned char $\ast$ \hyperlink{radio__interface_8c_3c4c46cf56117ca53071ba61db9004fb}{radio\_\-serial\_\-rx\_\-buffer}}
\label{radio__interface_8c_3c4c46cf56117ca53071ba61db9004fb}

\begin{CompactList}\small\item\em Serial receive buffer. \item\end{CompactList}\item 
\hypertarget{radio__interface_8c_b480e7940337a3432a4aa8645cafc002}{
unsigned char $\ast$ \hyperlink{radio__interface_8c_b480e7940337a3432a4aa8645cafc002}{radio\_\-serial\_\-rx\_\-buffer\_\-start}}
\label{radio__interface_8c_b480e7940337a3432a4aa8645cafc002}

\begin{CompactList}\small\item\em Start address of the serial receive buffer. \item\end{CompactList}\item 
\hypertarget{radio__interface_8c_6a072d4edd0594663a37f0e41633cc0c}{
\hyperlink{structstruct__radio__status}{struct\_\-radio\_\-status} \hyperlink{radio__interface_8c_6a072d4edd0594663a37f0e41633cc0c}{radio\_\-status}}
\label{radio__interface_8c_6a072d4edd0594663a37f0e41633cc0c}

\begin{CompactList}\small\item\em Radio status struct. \item\end{CompactList}\item 
\hypertarget{radio__interface_8c_32636f8d328cb44fd568d4ff8ad26b19}{
\hyperlink{structstruct__radio__settings}{struct\_\-radio\_\-settings} \hyperlink{radio__interface_8c_32636f8d328cb44fd568d4ff8ad26b19}{radio\_\-settings}}
\label{radio__interface_8c_32636f8d328cb44fd568d4ff8ad26b19}

\begin{CompactList}\small\item\em Radio settings struct. \item\end{CompactList}\item 
\hypertarget{radio__interface_8c_912f17736dd98ef0217d63835f8f7c06}{
unsigned char \hyperlink{radio__interface_8c_912f17736dd98ef0217d63835f8f7c06}{radio\_\-flags}}
\label{radio__interface_8c_912f17736dd98ef0217d63835f8f7c06}

\begin{CompactList}\small\item\em Flags to indicate various things which has happened to the radio. \item\end{CompactList}\item 
\hypertarget{radio__interface_8c_c3fcaf97ae109d1f1817e2a819c18a35}{
unsigned char \hyperlink{radio__interface_8c_c3fcaf97ae109d1f1817e2a819c18a35}{ptt\_\-status} = 0}
\label{radio__interface_8c_c3fcaf97ae109d1f1817e2a819c18a35}

\begin{CompactList}\small\item\em Flag which does indicate if the radio is transmitting, amp is active etc. \item\end{CompactList}\item 
\hypertarget{radio__interface_8c_71155d68bb0faa5b2976b5bec28ca0ca}{
unsigned char \hyperlink{radio__interface_8c_71155d68bb0faa5b2976b5bec28ca0ca}{radio\_\-rx\_\-data\_\-counter}}
\label{radio__interface_8c_71155d68bb0faa5b2976b5bec28ca0ca}

\begin{CompactList}\small\item\em External variable of the radio rx data counter used for a timeout. \item\end{CompactList}\end{CompactItemize}


\subsection{Detailed Description}
Radio interface, such as PTT AMP, PTT Radio, CAT etc. 

\begin{Desc}
\item[Author:]Mikael Larsmark, SM2WMV \end{Desc}
\begin{Desc}
\item[Date:]2010-01-25 

\begin{Code}\begin{verbatim} #include "front_panel/radio_interface.c " 
\end{verbatim}
\end{Code}

 \end{Desc}


Definition in file \hyperlink{radio__interface_8c-source}{radio\_\-interface.c}.

\subsection{Function Documentation}
\hypertarget{radio__interface_8c_04e120b697031fe7765c1b91eb8a7402}{
\index{radio\_\-interface.c@{radio\_\-interface.c}!radio\_\-communicaton\_\-timeout@{radio\_\-communicaton\_\-timeout}}
\index{radio\_\-communicaton\_\-timeout@{radio\_\-communicaton\_\-timeout}!radio_interface.c@{radio\_\-interface.c}}
\subsubsection[{radio\_\-communicaton\_\-timeout}]{\setlength{\rightskip}{0pt plus 5cm}void radio\_\-communicaton\_\-timeout (void)}}
\label{radio__interface_8c_04e120b697031fe7765c1b91eb8a7402}


This function should be called if an timeout has occured on the serial communication. This function will then reset the pointers used for the CAT decoding 

Definition at line 415 of file radio\_\-interface.c.

References struct\_\-radio\_\-status::box\_\-sent\_\-request, radio\_\-serial\_\-rx\_\-buffer, and radio\_\-serial\_\-rx\_\-buffer\_\-start.

Referenced by ISR().\hypertarget{radio__interface_8c_caebb53da61230cc0e72ac7fca61fe3f}{
\index{radio\_\-interface.c@{radio\_\-interface.c}!radio\_\-freq\_\-to\_\-band@{radio\_\-freq\_\-to\_\-band}}
\index{radio\_\-freq\_\-to\_\-band@{radio\_\-freq\_\-to\_\-band}!radio_interface.c@{radio\_\-interface.c}}
\subsubsection[{radio\_\-freq\_\-to\_\-band}]{\setlength{\rightskip}{0pt plus 5cm}unsigned char radio\_\-freq\_\-to\_\-band (unsigned int {\em freq})}}
\label{radio__interface_8c_caebb53da61230cc0e72ac7fca61fe3f}


Convert a radio frequency (integer) to band data. 

\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em freq}]The frequency as integer \end{description}
\end{Desc}
\begin{Desc}
\item[Returns:]The band of the frequency sent in as parameter. If band not found then it returns BAND\_\-UNDEFINED \end{Desc}


Definition at line 315 of file radio\_\-interface.c.

References band\_\-ctrl\_\-get\_\-high\_\-portion\_\-high(), and band\_\-ctrl\_\-get\_\-low\_\-portion\_\-low().

Referenced by radio\_\-process\_\-tasks().\hypertarget{radio__interface_8c_4a29bb17605c63566c6daa1e2c3f901d}{
\index{radio\_\-interface.c@{radio\_\-interface.c}!radio\_\-get\_\-band\_\-portion@{radio\_\-get\_\-band\_\-portion}}
\index{radio\_\-get\_\-band\_\-portion@{radio\_\-get\_\-band\_\-portion}!radio_interface.c@{radio\_\-interface.c}}
\subsubsection[{radio\_\-get\_\-band\_\-portion}]{\setlength{\rightskip}{0pt plus 5cm}unsigned char radio\_\-get\_\-band\_\-portion (void)}}
\label{radio__interface_8c_4a29bb17605c63566c6daa1e2c3f901d}


Get the portion of the band the radio is on. \begin{Desc}
\item[Returns:]Return BAND\_\-HIGH if it's in the higher portion of the band, BAND\_\-LOW if it's the lower portion. If neither then it returns BAND\_\-UNDEFINED \end{Desc}


Definition at line 180 of file radio\_\-interface.c.

References band\_\-ctrl\_\-get\_\-high\_\-portion\_\-high(), band\_\-ctrl\_\-get\_\-high\_\-portion\_\-low(), band\_\-ctrl\_\-get\_\-low\_\-portion\_\-high(), band\_\-ctrl\_\-get\_\-low\_\-portion\_\-low(), struct\_\-radio\_\-status::current\_\-band, and struct\_\-radio\_\-status::current\_\-freq.

Referenced by band\_\-ctrl\_\-get\_\-portion(), display\_\-update\_\-radio\_\-freq(), and main().\hypertarget{radio__interface_8c_b3eaafedab168f67c06084b7c8748d16}{
\index{radio\_\-interface.c@{radio\_\-interface.c}!radio\_\-get\_\-cat\_\-status@{radio\_\-get\_\-cat\_\-status}}
\index{radio\_\-get\_\-cat\_\-status@{radio\_\-get\_\-cat\_\-status}!radio_interface.c@{radio\_\-interface.c}}
\subsubsection[{radio\_\-get\_\-cat\_\-status}]{\setlength{\rightskip}{0pt plus 5cm}unsigned char radio\_\-get\_\-cat\_\-status (void)}}
\label{radio__interface_8c_b3eaafedab168f67c06084b7c8748d16}


This function will tell us if the openASC box has sent any request to the radio \begin{Desc}
\item[Returns:]1 if a request has been sent, 0 otherwise \end{Desc}


Definition at line 423 of file radio\_\-interface.c.

References struct\_\-radio\_\-status::box\_\-sent\_\-request.

Referenced by ISR().\hypertarget{radio__interface_8c_1bed199ceaacdb11c6f0449e9d864d6b}{
\index{radio\_\-interface.c@{radio\_\-interface.c}!radio\_\-get\_\-current\_\-band@{radio\_\-get\_\-current\_\-band}}
\index{radio\_\-get\_\-current\_\-band@{radio\_\-get\_\-current\_\-band}!radio_interface.c@{radio\_\-interface.c}}
\subsubsection[{radio\_\-get\_\-current\_\-band}]{\setlength{\rightskip}{0pt plus 5cm}unsigned char radio\_\-get\_\-current\_\-band (void)}}
\label{radio__interface_8c_1bed199ceaacdb11c6f0449e9d864d6b}


Retrieve the current band from the radio. 

\begin{Desc}
\item[Returns:]The radios band \end{Desc}


Definition at line 120 of file radio\_\-interface.c.

References struct\_\-radio\_\-status::current\_\-band.

Referenced by event\_\-internal\_\-comm\_\-parse\_\-message(), and main().\hypertarget{radio__interface_8c_be6b3a77368567c874ff9e7928aa20f5}{
\index{radio\_\-interface.c@{radio\_\-interface.c}!radio\_\-get\_\-current\_\-freq@{radio\_\-get\_\-current\_\-freq}}
\index{radio\_\-get\_\-current\_\-freq@{radio\_\-get\_\-current\_\-freq}!radio_interface.c@{radio\_\-interface.c}}
\subsubsection[{radio\_\-get\_\-current\_\-freq}]{\setlength{\rightskip}{0pt plus 5cm}unsigned int radio\_\-get\_\-current\_\-freq (void)}}
\label{radio__interface_8c_be6b3a77368567c874ff9e7928aa20f5}


Retrieve the frequency from the radio. If it's configured for BCD it just retrieves the freq band The frequency is returned as an integer so for example 21350 means 21 MHz and 350 kHz. \begin{Desc}
\item[Returns:]The frequency as an integer, max freq 65536 \end{Desc}


Definition at line 113 of file radio\_\-interface.c.

References struct\_\-radio\_\-status::current\_\-freq.

Referenced by display\_\-update\_\-radio\_\-freq().\hypertarget{radio__interface_8c_1a39fb3b7db71c081267934fefd0f425}{
\index{radio\_\-interface.c@{radio\_\-interface.c}!radio\_\-interface\_\-get\_\-baudrate@{radio\_\-interface\_\-get\_\-baudrate}}
\index{radio\_\-interface\_\-get\_\-baudrate@{radio\_\-interface\_\-get\_\-baudrate}!radio_interface.c@{radio\_\-interface.c}}
\subsubsection[{radio\_\-interface\_\-get\_\-baudrate}]{\setlength{\rightskip}{0pt plus 5cm}unsigned char radio\_\-interface\_\-get\_\-baudrate (void)}}
\label{radio__interface_8c_1a39fb3b7db71c081267934fefd0f425}


Get which baudrate setting is used. 

\begin{Desc}
\item[Returns:]Which baudrate setting is used \end{Desc}


Definition at line 380 of file radio\_\-interface.c.

References struct\_\-radio\_\-settings::baudrate.\hypertarget{radio__interface_8c_ef0cb2a66f8e664a436d8438ece9e581}{
\index{radio\_\-interface.c@{radio\_\-interface.c}!radio\_\-interface\_\-get\_\-civ\_\-addr@{radio\_\-interface\_\-get\_\-civ\_\-addr}}
\index{radio\_\-interface\_\-get\_\-civ\_\-addr@{radio\_\-interface\_\-get\_\-civ\_\-addr}!radio_interface.c@{radio\_\-interface.c}}
\subsubsection[{radio\_\-interface\_\-get\_\-civ\_\-addr}]{\setlength{\rightskip}{0pt plus 5cm}unsigned char radio\_\-interface\_\-get\_\-civ\_\-addr (void)}}
\label{radio__interface_8c_ef0cb2a66f8e664a436d8438ece9e581}


Get which CI-V address the radio has got. 

\begin{Desc}
\item[Returns:]The CI-V address \end{Desc}


Definition at line 392 of file radio\_\-interface.c.

References struct\_\-radio\_\-settings::civ\_\-addr.\hypertarget{radio__interface_8c_2a21b606f4854195179fba78e566dc68}{
\index{radio\_\-interface.c@{radio\_\-interface.c}!radio\_\-interface\_\-get\_\-interface@{radio\_\-interface\_\-get\_\-interface}}
\index{radio\_\-interface\_\-get\_\-interface@{radio\_\-interface\_\-get\_\-interface}!radio_interface.c@{radio\_\-interface.c}}
\subsubsection[{radio\_\-interface\_\-get\_\-interface}]{\setlength{\rightskip}{0pt plus 5cm}unsigned char radio\_\-interface\_\-get\_\-interface (void)}}
\label{radio__interface_8c_2a21b606f4854195179fba78e566dc68}


Get which radio interface is used. 

\begin{Desc}
\item[Returns:]The interface type \end{Desc}


Definition at line 374 of file radio\_\-interface.c.

References struct\_\-radio\_\-settings::interface\_\-type.

Referenced by band\_\-ctrl\_\-get\_\-portion(), display\_\-update\_\-radio\_\-freq(), event\_\-aux2\_\-button\_\-pressed(), and main().\hypertarget{radio__interface_8c_e611bf1461b229d7cc0d2c43a832f52a}{
\index{radio\_\-interface.c@{radio\_\-interface.c}!radio\_\-interface\_\-get\_\-model@{radio\_\-interface\_\-get\_\-model}}
\index{radio\_\-interface\_\-get\_\-model@{radio\_\-interface\_\-get\_\-model}!radio_interface.c@{radio\_\-interface.c}}
\subsubsection[{radio\_\-interface\_\-get\_\-model}]{\setlength{\rightskip}{0pt plus 5cm}unsigned char radio\_\-interface\_\-get\_\-model (void)}}
\label{radio__interface_8c_e611bf1461b229d7cc0d2c43a832f52a}


Get which radio model is used. 

\begin{Desc}
\item[Returns:]The radio model \end{Desc}


Definition at line 368 of file radio\_\-interface.c.

References struct\_\-radio\_\-settings::radio\_\-model.\hypertarget{radio__interface_8c_7552853363a7931bfbf9ee315c6e5c47}{
\index{radio\_\-interface.c@{radio\_\-interface.c}!radio\_\-interface\_\-get\_\-poll\_\-interval@{radio\_\-interface\_\-get\_\-poll\_\-interval}}
\index{radio\_\-interface\_\-get\_\-poll\_\-interval@{radio\_\-interface\_\-get\_\-poll\_\-interval}!radio_interface.c@{radio\_\-interface.c}}
\subsubsection[{radio\_\-interface\_\-get\_\-poll\_\-interval}]{\setlength{\rightskip}{0pt plus 5cm}unsigned char radio\_\-interface\_\-get\_\-poll\_\-interval (void)}}
\label{radio__interface_8c_7552853363a7931bfbf9ee315c6e5c47}


Get the poll intervall for the radio band decoding. 

\begin{Desc}
\item[Returns:]The poll interval in ms/10 \end{Desc}


Definition at line 404 of file radio\_\-interface.c.

References struct\_\-radio\_\-settings::poll\_\-interval.

Referenced by ISR().\hypertarget{radio__interface_8c_4874445eead299650a432340c81e8e71}{
\index{radio\_\-interface.c@{radio\_\-interface.c}!radio\_\-interface\_\-get\_\-ptt\_\-input@{radio\_\-interface\_\-get\_\-ptt\_\-input}}
\index{radio\_\-interface\_\-get\_\-ptt\_\-input@{radio\_\-interface\_\-get\_\-ptt\_\-input}!radio_interface.c@{radio\_\-interface.c}}
\subsubsection[{radio\_\-interface\_\-get\_\-ptt\_\-input}]{\setlength{\rightskip}{0pt plus 5cm}unsigned char radio\_\-interface\_\-get\_\-ptt\_\-input (void)}}
\label{radio__interface_8c_4874445eead299650a432340c81e8e71}


Get which PTT input that is used. 

\begin{Desc}
\item[Returns:]Which PTT input that is used \end{Desc}


Definition at line 398 of file radio\_\-interface.c.

References struct\_\-radio\_\-settings::ptt\_\-input.\hypertarget{radio__interface_8c_4f306aeac84c991bcac2bd62d2dad854}{
\index{radio\_\-interface.c@{radio\_\-interface.c}!radio\_\-interface\_\-get\_\-stopbits@{radio\_\-interface\_\-get\_\-stopbits}}
\index{radio\_\-interface\_\-get\_\-stopbits@{radio\_\-interface\_\-get\_\-stopbits}!radio_interface.c@{radio\_\-interface.c}}
\subsubsection[{radio\_\-interface\_\-get\_\-stopbits}]{\setlength{\rightskip}{0pt plus 5cm}unsigned char radio\_\-interface\_\-get\_\-stopbits (void)}}
\label{radio__interface_8c_4f306aeac84c991bcac2bd62d2dad854}


Get which number of stopbits should be used. 

\begin{Desc}
\item[Returns:]The number of stopbits that are used to interface the radio \end{Desc}


Definition at line 386 of file radio\_\-interface.c.

References struct\_\-radio\_\-settings::stopbits.\hypertarget{radio__interface_8c_179f074e00b02b7d16524c73bb9c44c9}{
\index{radio\_\-interface.c@{radio\_\-interface.c}!radio\_\-interface\_\-set\_\-baudrate@{radio\_\-interface\_\-set\_\-baudrate}}
\index{radio\_\-interface\_\-set\_\-baudrate@{radio\_\-interface\_\-set\_\-baudrate}!radio_interface.c@{radio\_\-interface.c}}
\subsubsection[{radio\_\-interface\_\-set\_\-baudrate}]{\setlength{\rightskip}{0pt plus 5cm}void radio\_\-interface\_\-set\_\-baudrate (unsigned char {\em baudrate})}}
\label{radio__interface_8c_179f074e00b02b7d16524c73bb9c44c9}


Set which baudrate setting is used, saves it in the radio\_\-settings struct. 

\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em baudrate}]Which baudrate setting to use \end{description}
\end{Desc}


Definition at line 338 of file radio\_\-interface.c.

References struct\_\-radio\_\-settings::baudrate.\hypertarget{radio__interface_8c_55390d2f6dd666ee613bad3e24318f52}{
\index{radio\_\-interface.c@{radio\_\-interface.c}!radio\_\-interface\_\-set\_\-civ\_\-addr@{radio\_\-interface\_\-set\_\-civ\_\-addr}}
\index{radio\_\-interface\_\-set\_\-civ\_\-addr@{radio\_\-interface\_\-set\_\-civ\_\-addr}!radio_interface.c@{radio\_\-interface.c}}
\subsubsection[{radio\_\-interface\_\-set\_\-civ\_\-addr}]{\setlength{\rightskip}{0pt plus 5cm}void radio\_\-interface\_\-set\_\-civ\_\-addr (unsigned char {\em civ})}}
\label{radio__interface_8c_55390d2f6dd666ee613bad3e24318f52}


Set which CI-V address the radio has got, saves it in the radio\_\-settings struct. 

\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em civ}]The CI-V address \end{description}
\end{Desc}


Definition at line 350 of file radio\_\-interface.c.

References struct\_\-radio\_\-settings::civ\_\-addr.\hypertarget{radio__interface_8c_7e697ec02d32d0e31b1c42f33a90ec2d}{
\index{radio\_\-interface.c@{radio\_\-interface.c}!radio\_\-interface\_\-set\_\-interface@{radio\_\-interface\_\-set\_\-interface}}
\index{radio\_\-interface\_\-set\_\-interface@{radio\_\-interface\_\-set\_\-interface}!radio_interface.c@{radio\_\-interface.c}}
\subsubsection[{radio\_\-interface\_\-set\_\-interface}]{\setlength{\rightskip}{0pt plus 5cm}void radio\_\-interface\_\-set\_\-interface (unsigned char {\em interface\_\-type})}}
\label{radio__interface_8c_7e697ec02d32d0e31b1c42f33a90ec2d}


Set which radio interface is used, saves it in the radio\_\-settings struct. 

\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em interface\_\-type}]The interface type \end{description}
\end{Desc}


Definition at line 332 of file radio\_\-interface.c.

References struct\_\-radio\_\-settings::interface\_\-type.\hypertarget{radio__interface_8c_7ee8e87d9f7b3979d0c50ba2cae7b848}{
\index{radio\_\-interface.c@{radio\_\-interface.c}!radio\_\-interface\_\-set\_\-model@{radio\_\-interface\_\-set\_\-model}}
\index{radio\_\-interface\_\-set\_\-model@{radio\_\-interface\_\-set\_\-model}!radio_interface.c@{radio\_\-interface.c}}
\subsubsection[{radio\_\-interface\_\-set\_\-model}]{\setlength{\rightskip}{0pt plus 5cm}void radio\_\-interface\_\-set\_\-model (unsigned char {\em model})}}
\label{radio__interface_8c_7ee8e87d9f7b3979d0c50ba2cae7b848}


Set which radio model is used, saves it in the radio\_\-settings struct. 

\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em model}]The radio model \end{description}
\end{Desc}


Definition at line 326 of file radio\_\-interface.c.

References struct\_\-radio\_\-settings::radio\_\-model.\hypertarget{radio__interface_8c_2f6356092aad19af9b7c162c6c3d83e8}{
\index{radio\_\-interface.c@{radio\_\-interface.c}!radio\_\-interface\_\-set\_\-poll\_\-interval@{radio\_\-interface\_\-set\_\-poll\_\-interval}}
\index{radio\_\-interface\_\-set\_\-poll\_\-interval@{radio\_\-interface\_\-set\_\-poll\_\-interval}!radio_interface.c@{radio\_\-interface.c}}
\subsubsection[{radio\_\-interface\_\-set\_\-poll\_\-interval}]{\setlength{\rightskip}{0pt plus 5cm}void radio\_\-interface\_\-set\_\-poll\_\-interval (unsigned char {\em poll\_\-interval})}}
\label{radio__interface_8c_2f6356092aad19af9b7c162c6c3d83e8}


Set the poll intervall for the radio band decoding, saves it in the radio\_\-settings struct. 

\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em poll\_\-interval}]The poll interval in ms/10 \end{description}
\end{Desc}


Definition at line 362 of file radio\_\-interface.c.

References struct\_\-radio\_\-settings::poll\_\-interval.\hypertarget{radio__interface_8c_ed43356a1535b55a5a6dbe2f456b1a25}{
\index{radio\_\-interface.c@{radio\_\-interface.c}!radio\_\-interface\_\-set\_\-ptt\_\-input@{radio\_\-interface\_\-set\_\-ptt\_\-input}}
\index{radio\_\-interface\_\-set\_\-ptt\_\-input@{radio\_\-interface\_\-set\_\-ptt\_\-input}!radio_interface.c@{radio\_\-interface.c}}
\subsubsection[{radio\_\-interface\_\-set\_\-ptt\_\-input}]{\setlength{\rightskip}{0pt plus 5cm}void radio\_\-interface\_\-set\_\-ptt\_\-input (unsigned char {\em ptt\_\-input})}}
\label{radio__interface_8c_ed43356a1535b55a5a6dbe2f456b1a25}


Set which PTT input that is used, saves it in the radio\_\-settings struct. 

\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em ptt\_\-input}]Which PTT input that is used \end{description}
\end{Desc}


Definition at line 356 of file radio\_\-interface.c.

References struct\_\-radio\_\-settings::ptt\_\-input.\hypertarget{radio__interface_8c_1993418adabfb6bc52752bda6321dd15}{
\index{radio\_\-interface.c@{radio\_\-interface.c}!radio\_\-interface\_\-set\_\-stopbits@{radio\_\-interface\_\-set\_\-stopbits}}
\index{radio\_\-interface\_\-set\_\-stopbits@{radio\_\-interface\_\-set\_\-stopbits}!radio_interface.c@{radio\_\-interface.c}}
\subsubsection[{radio\_\-interface\_\-set\_\-stopbits}]{\setlength{\rightskip}{0pt plus 5cm}void radio\_\-interface\_\-set\_\-stopbits (unsigned char {\em stopbits})}}
\label{radio__interface_8c_1993418adabfb6bc52752bda6321dd15}


Set which number of stopbits should be used, saves it in the radio\_\-settings struct. 

\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em stopbits}]The number of stopbits that are used to interface the radio \end{description}
\end{Desc}


Definition at line 344 of file radio\_\-interface.c.

References struct\_\-radio\_\-settings::stopbits.\hypertarget{radio__interface_8c_16172b8cd72ef37b1e963d2a771c34ca}{
\index{radio\_\-interface.c@{radio\_\-interface.c}!radio\_\-parse\_\-freq@{radio\_\-parse\_\-freq}}
\index{radio\_\-parse\_\-freq@{radio\_\-parse\_\-freq}!radio_interface.c@{radio\_\-interface.c}}
\subsubsection[{radio\_\-parse\_\-freq}]{\setlength{\rightskip}{0pt plus 5cm}unsigned int radio\_\-parse\_\-freq (unsigned char $\ast$ {\em freq\_\-data}, \/  unsigned char {\em length}, \/  unsigned char {\em radio\_\-model})}}
\label{radio__interface_8c_16172b8cd72ef37b1e963d2a771c34ca}


Parse the radios frequency. 

\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em freq\_\-data}]The frequency data sent in as an array of characters \item[{\em length}]The length of the frequency data \item[{\em radio\_\-model}]The type of radio that the freq should be parsed for \end{description}
\end{Desc}
\begin{Desc}
\item[Returns:]The radios frequency in integer format. So for example 21305 is 21 MHz and 305 kHz. \end{Desc}


Definition at line 243 of file radio\_\-interface.c.

References RADIO\_\-MODEL\_\-FT1000, RADIO\_\-MODEL\_\-FT1000MKV, RADIO\_\-MODEL\_\-ICOM, and RADIO\_\-MODEL\_\-KENWOOD.\hypertarget{radio__interface_8c_3dba8d119c14a022fce5bfcaca9c0e30}{
\index{radio\_\-interface.c@{radio\_\-interface.c}!radio\_\-poll\_\-ptt@{radio\_\-poll\_\-ptt}}
\index{radio\_\-poll\_\-ptt@{radio\_\-poll\_\-ptt}!radio_interface.c@{radio\_\-interface.c}}
\subsubsection[{radio\_\-poll\_\-ptt}]{\setlength{\rightskip}{0pt plus 5cm}unsigned char radio\_\-poll\_\-ptt (void)}}
\label{radio__interface_8c_3dba8d119c14a022fce5bfcaca9c0e30}


Polls the status of the PTT input. 

\begin{Desc}
\item[Returns:]Return RADIO\_\-PTT\_\-ACTIVATE if the radio is PTT and RADIO\_\-PTT\_\-DEACTIVATE if it doesn't \end{Desc}


Definition at line 197 of file radio\_\-interface.c.

References RADIO\_\-PTT\_\-DEACTIVE.\hypertarget{radio__interface_8c_51982d5e8375a0187b093e49225e564f}{
\index{radio\_\-interface.c@{radio\_\-interface.c}!radio\_\-poll\_\-status@{radio\_\-poll\_\-status}}
\index{radio\_\-poll\_\-status@{radio\_\-poll\_\-status}!radio_interface.c@{radio\_\-interface.c}}
\subsubsection[{radio\_\-poll\_\-status}]{\setlength{\rightskip}{0pt plus 5cm}unsigned char radio\_\-poll\_\-status (void)}}
\label{radio__interface_8c_51982d5e8375a0187b093e49225e564f}


Polls the status of the radio and saves it into the radio\_\-status structure. 

\begin{Desc}
\item[Returns:]0 if the poll went OK and 1 if it didn't \end{Desc}


Definition at line 205 of file radio\_\-interface.c.

References struct\_\-radio\_\-settings::civ\_\-addr, display\_\-update\_\-radio\_\-freq(), INHIBIT\_\-NOT\_\-OK\_\-TO\_\-SEND\_\-RADIO\_\-TX, INT\_\-COMM\_\-GET\_\-BAND\_\-BCD\_\-STATUS, struct\_\-radio\_\-settings::interface\_\-type, internal\_\-comm\_\-add\_\-tx\_\-message(), main\_\-get\_\-inhibit\_\-state(), RADIO\_\-INTERFACE\_\-BCD, RADIO\_\-INTERFACE\_\-CAT\_\-MON, RADIO\_\-INTERFACE\_\-CAT\_\-POLL, struct\_\-radio\_\-settings::radio\_\-model, RADIO\_\-MODEL\_\-ICOM, and usart3\_\-transmit().

Referenced by main().\hypertarget{radio__interface_8c_3b706c4ccad36a652ad17edcfbb7ee5f}{
\index{radio\_\-interface.c@{radio\_\-interface.c}!radio\_\-set\_\-current\_\-band@{radio\_\-set\_\-current\_\-band}}
\index{radio\_\-set\_\-current\_\-band@{radio\_\-set\_\-current\_\-band}!radio_interface.c@{radio\_\-interface.c}}
\subsubsection[{radio\_\-set\_\-current\_\-band}]{\setlength{\rightskip}{0pt plus 5cm}void radio\_\-set\_\-current\_\-band (unsigned char {\em band})}}
\label{radio__interface_8c_3b706c4ccad36a652ad17edcfbb7ee5f}


Set the current band \begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em band}]The band we wish to set \end{description}
\end{Desc}


Definition at line 191 of file radio\_\-interface.c.

References struct\_\-radio\_\-status::current\_\-band.

Referenced by event\_\-internal\_\-comm\_\-parse\_\-message().